<template>
  <!--头部区域-->
  <el-header>
    <i :class="collapseIcon" style="font-size: 26px;" @click="handleCollapse"></i>
    <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-left: 20px;">
      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>订单管理</el-breadcrumb-item>
      <el-breadcrumb-item>秒杀场次</el-breadcrumb-item>
      <el-breadcrumb-item>秒杀商品</el-breadcrumb-item>
    </el-breadcrumb>
    <div style=" flex: 1; width: 0; display: flex; align-items: center;justify-content: flex-end;
      ">
      <i class="el-icon-full-screen" style="font-size: 26px; cursor: pointer" @click="handleFull"></i>
      <el-dropdown placement="bottom">
        <div style="display: flex;align-items: center;cursor: default;">
          <img src="../assets/logo.png" width="40px" height="40px" style="margin: 0 5px;">
          <span>{{ admin.name }}</span>
        </div>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </el-header>
</template>

<script>
export default {
  name: "HeaderView.vue",

  props: {
    //默认显示图标为收缩图标
    collapseIcon: String,
    //管理员数据
    admin: Object,
    //退出登录
    logout: Function,
    //控制菜单的左右收缩
    handleCollapse: Function,
  },

  methods: {
    //控制屏幕状态
    handleFull() {
      if (!document.fullscreen) {
        document.documentElement.requestFullscreen()
      } else {
        document.exitFullscreen()
      }
    },
  },
}
</script>

<style>
@import "@/css/global.css";
</style>